import request from '@/utils/request'

// 查询联盟商家积分商品列表
export function listProduct(query) {
  return request({
    url: '/union/product/list',
    method: 'get',
    params: query
  })
}

// 查询联盟商家积分商品详细
export function getProduct(prodId) {
  return request({
    url: '/union/product/' + prodId,
    method: 'get'
  })
}

// 新增联盟商家积分商品
export function addProduct(data) {
  return request({
    url: '/union/product',
    method: 'post',
    data: data
  })
}

// 修改联盟商家积分商品
export function updateProduct(data) {
  return request({
    url: '/union/product',
    method: 'put',
    data: data
  })
}

// 删除联盟商家积分商品
export function delProduct(prodId) {
  return request({
    url: '/union/product/' + prodId,
    method: 'delete'
  })
}

export function changeProdStatus(prodId, valid) {
  return request({
    url: '/union/product/changeStatus',
    method: 'put',
    data: {
      prodId: prodId,
      valid: valid
    }
  })
}

export function listProductLog(query) {
  return request({
    url: '/union/product/showLog',
    method: 'get',
    params: query
  })
}
